package com.lv.baselibrary.util;

import android.text.TextUtils;

import com.lv.baselibrary.bean.PhoneMsgBean;

/**
 * @ClassName: PhoneMsgUtil
 * @Description:
 * @Author: lv
 * @Date: 2020/9/10 10:39
 */
public class PhoneMsgUtil {
    public static String getInfo(PhoneMsgBean phoneMsgBean) {
        String info = "";
        String tag = phoneMsgBean.getTag();
        if (!TextUtils.isEmpty(tag)) {
            if (tag.equals(PhoneContent.PHONE_CALL)) {
                info = "对方呼叫我";
            } else if (tag.equals(PhoneContent.PHONE_CANCLE)) {
                info = "对方取消通话";
            } else if (tag.equals(PhoneContent.PHONE_REFUSE)) {
                info = "对方拒绝通话";
            } else if (tag.equals(PhoneContent.PHONE_NOT_CONNECT)) {
                info = "对方未接通";
            } else if (tag.equals(PhoneContent.PHONE_ANSWERED)) {
                info = "已接听";
            } else if (tag.equals(PhoneContent.PHONE_HANG_UP)) {
                info = "对方已挂断";
            } else if (tag.equals(PhoneContent.PHONE_CONVERSATIONING)) {
                info = "正在通话中";
            }
        } else {
            info = "未知消息";
        }
        return info;
    }
}
